package armature;

import role.Assassin;
import role.Hero;
import role.Mage;
import role.Tank;

/**
* @author: luosiyu
* @Description: 向下转型
* @Date: 2022/10/22 12:50
*/
public final class TransUtils {
    static int damage2;
    static int damage3;

    private TransUtils() {
    }

    public static void trans(Hero h){

        if(h instanceof Assassin){
            Assassin a = (Assassin) h;
            damage2 = a.getDamage2();
            damage3 = a.getDamage3();
//            return a;
        };
        if(h instanceof Mage){
            Mage a = (Mage) h;
            damage2 = a.getDamage2();
            damage3 = a.getDamage3();
//            return  m;
        }
        if(h instanceof Tank){
            Tank a = (Tank) h;
            damage2 = a.getDamage2();
            damage3 = a.getDamage3();
//            return t;
        }
//        return h;
    }


}
